package L7.L713;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * 二进制转换
 *
 * @author: luolidong
 * @create: 2021-07-14 11:50
 * @version: 1.0
 */
public class Base {
    public static void main(String[] args) throws IOException {
        StringBuilder stringBuilder = new StringBuilder();
        InputStreamReader reader = new InputStreamReader(System.in);
        BufferedReader bufferedReader = new BufferedReader(reader);
        String s1 = bufferedReader.readLine();
        int n=Integer.parseInt(s1);
        while (n>0){
            stringBuilder.append(n%2);
            n=n / 2;
        }
        String s = stringBuilder.reverse().toString();
        System.out.println("2进制："+s);

        int len=0;
        int num=0;
        while (len<s.length()){
            num+=Math.pow(2,s.length()-len-1)*(s.charAt(len)-'0');
            len++;
        }
        System.out.println(num);
    }
}
